<!DOCTYPE html>
<html lang="zh-CN" ng-app='he'>
	<head>
		<meta charset='utf-8' />
	
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>审批</title>
		<script type="text/javascript">
			is_local='{{local}}';

			function loadjs(script_filename) {
		        document.write('\<script language="javascript" type="text/javascript" src="' + script_filename + '"\>\</script\>');
		    }
		    if(!is_local){
			    static_url='/static';
		    }else{
			    static_url='../../../../static';
		    }
		    // 加载所有微信页面需要的js和css
		    loadjs(static_url+'/js/hr/hr_js_css.js')
		</script>
		<script type="text/javascript">
			app.controller('content',function ($scope,$http,$location) {

				if(is_local){

				}else{
					$scope.upload=function () {
						url='/attendance/leaves/';
						$scope.leave_data.upload(url)
						.success(function (data, status, headers, config) {
							$scope.leave_suc_list=data.success_list
						}).error(function (data, status, headers, config) {
							alert(data.error)
						})
						
					}

					//--------------------------------
				}
			})
			
		
		</script>
	</head>
	<body ng-controller='content' style='background-color: white;'>
	
	
	<div class="container">
    <div class="row">
	    <h1>系统起步时，需要导入当年1月1日起的所有请假记录</h1>
	    <div class="panel panel-primary">
		    <div class="panel-heading">上传请假数据格式</div>

		    <div class="panel-body">
			  <table class="table">
			    <tr>
				    <td>id</td>
				    <td>empid</td>
				    <td>姓名</td>
				    <td>start_time</td>
				    <td>end_time</td>
				    <td>category</td>
			    </tr>
			    <tr>
				    <td>1</td>
				    <td>AE1856</td>
				    <td>何宇林</td>
				    <td>2016/2/4 8:30</td>
				    <td>2016/2/4 17:30</td>
				    <td>annual_leave</td>
			    </tr>
			    <tr>
				    <td>2</td>
				    <td>AE1856</td>
				    <td>何宇林</td>
				    <td>2016/2/5 8:30</td>
				    <td>2016/2/5 17:30</td>
				    <td>sick_leave</td>
			    </tr>
		    </table>
			    
		    </div>
	    </div>
	    <ul>
		    <li>年假:annual_leave</li>
		    <li>事假:personal_leave</li>
		    <li>病假:sick_leave</li>
		    <li>调休:swap_off</li>
		    <li>外出办公:out_of</li>
		    <li>漏打卡:miss_check</li>
		    <li>生日假:birthday_leave</li>
		    <li>除年假外带薪假：others</li>
	    </ul>
	    <div file-loader
			self='leave_data' 
			accept='.xlsx'>
		</div>
		<button name="test" type="button" value="val" ng-click='upload()' ng-disabled='!leave_data.name'>上传</button>
    </div>
    <div >
	    <span>上传成功的id:</span>
	    <table>
	    	<tr ng-repeat='i in leave_suc_list'>
		    	<td ng-bind='i'></td>
	    	</tr>
	    </table>
    </div>
	</div>
		
	</body>
</html>